#coding:utf-8
import sys
from PyQt5 import uic
from PyQt5.QtWidgets  import QApplication
from PyQt5.QtWidgets import QMainWindow

class Calc(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi('calc.ui',self)
        





class Calc(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi('calc.ui',self)
        btns=[
                self.pushButton0,
                self.pushButton1,
                self.pushButton2,
                self.pushButton3,
                self.pushButton4,
                self.pushButton5,
                self.pushButton6,
                self.pushButton7,
                self.pushButton8,
                self.pushButton9,
                self.pushButton_clear,
                self.pushButton_add,
                self.pushButton_sub,
                self.pushButton_div,
                self.pushButton_mul,
                self.pushButton_dot,
                self.pushButton_equal
        ]

        map(lambda btn:btn.clicked.connect(self.f),btns)

        
    def f(self):
        print self.sender().text()









if __name__ == '__main__':    
    app = QApplication(sys.argv)
    # print help(QApplication)
    calc = Calc()
    calc.show()
    app.exec_()




